diagonal difference hacker rank solution in python